package edu.zut.bailan.cart.domain;

import edu.zut.bailan.base.domain.BaseEntity;

import javax.persistence.*;

public class Cart extends BaseEntity<Long> {
    public CartGroup getCartGroup() {
        return cartGroup;
    }

    public void setCartGroup(CartGroup cartGroup) {
        this.cartGroup = cartGroup;
    }

    /**
     *
     */
    private static final long serialVersionUID = 7308677292852312663L;

    @ManyToOne
    @JoinColumn(name = "CART_GROUP_ID")
    CartGroup cartGroup;

    /**
     * code of edu.zut.bailan.cart
     */
    @Column(name = "CODE")
    String code;

    /**
     * price for edu.zut.bailan.cart
     */
    @Column(name = "PRICE")
    Integer price;

    @OneToOne(mappedBy = "edu.zut.bailan.cart",cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    CartRemark cartRemark;

    public Cart() {

    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public CartRemark getCartRemark() {
        return cartRemark;
    }

    public void setCartRemark(CartRemark cartRemark) {
        this.cartRemark = cartRemark;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
